import request from '@/utils/request.js'
// import { useTokenStore } from '@/stores/token.js'

export const dormitoryCategoryListService = () => {
    // const tokenStore = useTokenStore();
    // return request.get('/category', {headers: { 'Authorization': tokenStore.token }})
    return request.get('/category')
}

export const addDormitoryCategoryService = (categoryData)=>{
    return request.post('/category',categoryData)
}

export const updateDormitoryCategoryService = (categoryData)=>{
    return request.put('/category',categoryData)
}

export const deleteDormitoryCategoryService = (categoryId)=>{
    return request.delete('/category?id='+categoryId)
}

// export const dormitoryCategoryList = ()=>{
//     return request.get('/category')
// }

export const dormitoryListService = (params)=>{
    return request.get('/dormitory',{params:params})
}

export const dormitoryAddService = (dormitoryModel)=>{
    return request.post('/dormitory',dormitoryModel)
}

export const updateDormitoryService = (dormitoryModel)=>{
    return request.put('/dormitory',dormitoryModel)
}

export const deleteDormitoryService = (id)=>{
    return request.delete('/dormitory?id='+id)
}

export const listDormitoryService = ()=>{
    return request.get('/dormitory/list')
}

//根据id查询宿舍信息
export const listFindByIdService = (id)=>{
    return request.get('/dormitory/detail?id='+id)
}

export const findPeoService = (params)=>{
    return request.get('/dormitory/findPeo',{params:params})
}


